/*****************************************************************************
 * Copyright (c) 2010 -, Anders All rights reserved
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 * 
 *  Contact: Anders Uddenberg (anders.uddenberg@gmail.com)
 * 
 *
 ****************************************************************************/
package org.easypr.organizer.client.event;

import com.google.gwt.event.shared.GwtEvent;

// TODO: Auto-generated Javadoc
/**
 * The Class DisplayInformationEvent.
 */
public class DisplayInformationEvent extends GwtEvent<DisplayInformationEventHandler> {
	/** The TYPE. */
	public static Type<DisplayInformationEventHandler> TYPE = new Type<DisplayInformationEventHandler>();
	
	/**
	 * The Enum Severity.
	 */
	public enum Severity {
		
		/** The SUCCESS. */
		SUCCESS,
		
		/** The INFORMATION. */
		INFORMATION,
		
		/** The USE r_ error. */
		USER_ERROR,
		
		/** The FAILURE. */
		FAILURE
	};
	
	/** The message. */
	private String message;
	
	/** The severity. */
	private DisplayInformationEvent.Severity severity;
	
	/**
	 * Instantiates a new display information event.
	 *
	 * @param message the message
	 * @param severity the severity
	 */
	public DisplayInformationEvent(String message, DisplayInformationEvent.Severity severity) {
		this.message = message;
		this.severity = severity;
	}
	
	/**
	 * Gets the message.
	 *
	 * @return the message
	 */
	public String getMessage() {
		return this.message; 
	}
	
	/**
	 * Gets the severity.
	 *
	 * @return the severity
	 */
	public DisplayInformationEvent.Severity getSeverity() {
		return this.severity;
	}
	
	/* (non-Javadoc)
	 * @see com.google.gwt.event.shared.GwtEvent#dispatch(com.google.gwt.event.shared.EventHandler)
	 */
	protected void dispatch(DisplayInformationEventHandler handler) {
		handler.onDisplayInformation(this);
	}

	/* (non-Javadoc)
	 * @see com.google.gwt.event.shared.GwtEvent#getAssociatedType()
	 */
	public Type<DisplayInformationEventHandler> getAssociatedType() {
		return TYPE;
	}
}
